package com.datamation.swadeshi.view;

import com.datamation.swadeshi.R;

import android.app.ActionBar;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class ConnectionURLActivity extends Activity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ip_connection);
		setTitleBarColor();
	}

	//Title bar color 
	private void  setTitleBarColor(){
		ActionBar bar = getActionBar();
		bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#336699")));
		//title 
		createCutomActionBarTitle("Swadeshi");		
	}
	
    private void createCutomActionBarTitle(String title){
        
    	this.getActionBar().setDisplayShowCustomEnabled(true);
        this.getActionBar().setDisplayShowTitleEnabled(false);

        LayoutInflater inflator = LayoutInflater.from(this);
        View v = inflator.inflate(R.layout.custom_action_bar, null);

        //Typeface tf = Typeface.createFromAsset(getAssets(),"fonts/fat_tats.ttf");
        Typeface tf = Typeface.createFromAsset(getAssets(),"fonts/coopbl.ttf");
        
        TextView tvTitle = (TextView)v.findViewById(R.id.titleFragment1);
        tvTitle.setText(title);
        tvTitle.setTypeface(tf);
      
        //assign the view to the actionbar
        this.getActionBar().setCustomView(v);
    }

}
